<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:isc="http://extension-functions.intersystems.com" xmlns:hl7="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:exsl="http://exslt.org/common" exclude-result-prefixes="isc hl7 xsi exsl">

		
	<!-- 预防接种史章节 -->
	<xsl:template match="*" mode="VaccinationSection">
		<xsl:apply-templates select="$sectionRootPath[hl7:code/@code=$hcc_HistoryOfImmunications]" mode="VaccinationEntry">
		</xsl:apply-templates>
	</xsl:template>
	<!-- 预防接种史章节条目 -->
	<xsl:template match="*" mode="VaccinationEntry">
	    <!-- only process smorking, drinking and food items -->
		<xsl:apply-templates select="hl7:entry/hl7:observation" mode="HCCVaccination">
			<xsl:with-param name="sectionType" select="'SD'"/>
		</xsl:apply-templates>
	</xsl:template>	

	
	<!--通用预防接种史条目输出模板-->
	<xsl:template match="*" mode="HCCVaccination">
		<xsl:param name = "sectionType" />
		<xsl:variable name="itemType"><xsl:value-of select="hl7:code/@code"/></xsl:variable>
		<Vaccination>
			<EncounterNumber><xsl:value-of select="$encompassingEncounterID"/></EncounterNumber>
			<ExternalId><xsl:value-of select="concat($hccDocNo,'-',$sectionType,'-',position())"/></ExternalId>
			<OrderItem>
				<Code><xsl:value-of select="hl7:value"/></Code>
				<Description><xsl:value-of select="hl7:value"/></Description>
			</OrderItem>
			<Status><xsl:value-of select="'Executed'"/></Status>
			<FromTime><xsl:value-of select="'20220201'"/></FromTime>
		</Vaccination>		
	</xsl:template>
	
</xsl:stylesheet>
